using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

public class PathTools
{
    

    public const string Windows = "Windows";
    public const string IOS = "IOS";
    public const string Android = "Android";
    public const string WebGL = "WebGL";
    public const string Verity = "Verity.json";
    public const string ReaderMe = "readerme.txt";
    public const string AssetPackageAssetVersion ="version.json";
    public const string AssetPackage_Lua = "/Lua";

    #region CSV路径
    public static readonly string CsvFloderName = "Config/csv";
    public static readonly string CsvFloderPath = AssetPackagePath + "/" + CsvFloderName + "/";
    public static readonly string CSV_SUFFIX = ".csv";
    public static readonly string CSV_ScriptSavePath = Application.dataPath + "/Scripts/App/CSV/";


    public static string GetCsvPath_Win(string path)
    {
        return CsvFloderPath + "/" + path + CSV_SUFFIX;
    }

    public static string GetAsynCsvPath(string path)
    {
        if (Application.platform == RuntimePlatform.Android
           || Application.platform == RuntimePlatform.IPhonePlayer)
        {
            return Application.streamingAssetsPath + "/" + CsvFloderName + "/" + path + CSV_SUFFIX;
        }
        return "file://" + Application.dataPath + "/../" + CsvFloderName + "/" + path + CSV_SUFFIX;
    }
    #endregion

    #region 客户端读取本地资源路径
    public const string Asset_root = "/StreamingAssets/";
    static public string Asset_local_path { get { return Application.persistentDataPath; } }
    #endregion

    static public string LuaScriptEidtorPath =>Application.dataPath + "/Scripts/3rd/Lua/scr/";
    ///<summary> Application.streamingAssetsPath 路径 </summary>
    static public string StreamingAssetsPath => Application.streamingAssetsPath;
    static public string AssetPackagePath =>Application.dataPath + "/AssetPackage";
    ///<summary> 资源预更新保存路径 </summary>
    static public string WillUpdateAssetPath =>@"I:/StreamingAssets/" +PlatformName+"/";
    ///<summary> 服务器资源路径 </summary>
    static public string Asset_Server = "https://127.0.0.1";
    ///<summary> 打包资源保存路径 </summary>
    static public string OutAssetBundlePath => Application.streamingAssetsPath + "/" + PlatformName;
    ///<summary> 客户端读取AB包路径 </summary>
    static public string AssetBundlePath =>Application.persistentDataPath + Asset_root + PlatformName;
      ///<summary> 当前平台名称 </summary>
    static public string PlatformName
    {
        get
        {
            string _name = PathTools.Windows;
            switch (Application.platform)
            {
                case RuntimePlatform.IPhonePlayer:
                    _name = PathTools.IOS;
                    break;

                case RuntimePlatform.Android:
                    _name = PathTools.Android;
                    break;
                case RuntimePlatform.WebGLPlayer:
                    _name = PathTools.WebGL;
                    break;
            }
            return _name;
        }
    }



}
